Skip to content

release: 0.4.0#5

Merged
kriptoburak merged 19 commits intomainfrom
release-please--branches--main--changes--next
May 6, 2026
Merged

release: 0.4.0#5
kriptoburak merged 19 commits intomainfrom
release-please--branches--main--changes--next

Conversation

@stainless-app
Copy link
Copy Markdown
Contributor

@stainless-app stainless-app Bot commented Apr 22, 2026

Automated Release PR

0.4.0 (2026-04-25)

Full Changelog: v0.3.0...v0.4.0

Features

Bug Fixes

  • escape ampersand in OpenAPI summaries for C# XML docs (fb78c9a)

Chores

  • sync OpenAPI spec (c225ad8)
  • wire production_repo for all targets (1a3de89)

Documentation

  • add Contributor Covenant 2.1 Code of Conduct (#2192) (afb97b0)

This pull request is managed by Stainless's GitHub App.

The semver version number is based on included commit messages. Alternatively, you can manually set the version number in the title of this pull request.

For a better experience, it is recommended to use either rebase-merge or squash-merge when merging this pull request.

🔗 Stainless website
📚 Read the docs
🙋 Reach out for help or questions

Note

Release 0.4.0 with new credit, health, and radar API model changes

  • Removes integrations() and bot() from both blocking and async client interfaces and implementations, and drops FOLLOWER_GAINED/FOLLOWER_LOST from EventType and STREAM_REGISTRATION_FAILED/USAGE_LIMIT_REACHED from Error.
  • Adds health (enum) as a required field on XAccount, XAccountDetail, AccountCreateResponse, and AccountReauthResponse; adds creditInfo (replacing currentPeriod) on AccountRetrieveResponse with autoTopupEnabled, balance, lifetimePurchased, and lifetimeUsed.
  • Changes RadarItem to use strongly-typed Category and Source enums and adds required fields id, createdAt, language, metadata, and sourceId; RadarRetrieveTrendingTopicsParams replaces count with cursor-based after/limit and an enum category; response replaces total with hasMore/nextCursor.
  • Makes tweet text optional in TweetCreateParams and adds an optional media list (URLs); adds count and woeid optional params to XGetTrendsParams.
  • Moves security header injection into ClientOptions constructor and removes per-call SecurityOptions from prepare/prepareAsync, so bearer tokens and API keys are set once at client construction time.
  • SearchTweet and UserProfile are relocated from sub-packages to com.x_twitter_scraper.api.models; ExtractionEstimateCostResponse replaces projectedPercent/usagePercent with creditsAvailable, creditsRequired, and optional resolvedXUserId.
  • Risk: multiple breaking API contract changes — removed fields (currentPeriod, count, total, projectedPercent, usagePercent), removed client methods (integrations(), bot()), and new required fields (health, createdAt, etc.) will cause runtime failures for callers that do not update.

Macroscope summarized cb52b50.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 22, 2026

Too many files changed for review. (267 files found, 200 file limit)

@stainless-app
Copy link
Copy Markdown
Contributor Author

stainless-app Bot commented Apr 22, 2026

🧪 Testing

To try out this version of the SDK:

Add the following URL as a Maven source: 'https://pkg.stainless.com/s/x-twitter-scraper-java/fb78c9aea1252be7535e3b5efcc5f916805831d4/mvn'

Expires at: Mon, 25 May 2026 05:32:12 GMT
Updated at: Sat, 25 Apr 2026 05:32:12 GMT

@stainless-app stainless-app Bot force-pushed the release-please--branches--main--changes--next branch from 40a8eed to da32a76 Compare April 22, 2026 21:26
@stainless-app stainless-app Bot force-pushed the release-please--branches--main--changes--next branch from da32a76 to 0e1dfb9 Compare April 25, 2026 05:27
Comment on lines +588 to +596
category().validate()
createdAt()
language()
metadata().validate()
publishedAt()
region()
score()
source()
source().validate()
sourceId()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: When responseValidation is enabled, validate() will crash if new required fields are missing from the API response, which can happen with an older backend.
Severity: MEDIUM

Suggested Fix

The validation logic could be made more lenient for these new fields, perhaps by making them optional in the validate() method or by providing a versioning mechanism. Alternatively, clearly document this breaking change and advise users to update their backend API and SDK simultaneously, especially if they rely on response validation.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location:
x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/radar/RadarItem.kt#L588-L596

Potential issue: The `RadarItem`, `AccountReauthResponse`, and `AccountCreateResponse`
models have new required fields. If the SDK is used against an older API version that
does not return these fields, deserialization will succeed but the fields will be marked
as `JsonMissing`. If the user has explicitly enabled `responseValidation=true` (which is
`false` by default), the `validate()` method will be called. This method attempts to
access the required fields, triggering a `getRequired()` call that throws an
`XTwitterScraperInvalidDataException` for any missing field, causing a runtime crash.
This issue arises from a version mismatch between the client and the server.

Also affects:

  • x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/x/accounts/AccountReauthResponse.kt:378~382
  • x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/x/accounts/AccountCreateResponse.kt:378~382

Did we get this right? 👍 / 👎 to inform future reviews.

@kriptoburak kriptoburak merged commit 5cc3d23 into main May 6, 2026
12 checks passed
@kriptoburak kriptoburak deleted the release-please--branches--main--changes--next branch May 6, 2026 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant